#ifndef TODAY_H
#define TODAY_H

#include <QObject>
#include <QWidget>

#include <QPainter>
#include <QColor>
#include <QLabel>
#include <QPixmap>
#include <QFont>
#include <QWidget>
#include <QLabel>
#include <QHBoxLayout>

#include "weather_json.h"
class Today : public QWidget
{
    Q_OBJECT
public:
    explicit Today(QWidget *parent = nullptr);
    void setTemperature(const QString &temp);
    void setWisdomText(const QString &text);
    void setIcon(const QPixmap &pixmap);

private:
    void setupUI();
    int temp;
    QString icon_path;
    QString sentence;
    QString type;
private:
    QLabel *m_iconLabel;
    QLabel *m_tempLabel;
    QLabel *m_wisdomLabel;
private:
    QColor color;
    // 设置背景
    void set_color(QColor color);
    // 绘制事件
    void paintEvent(QPaintEvent *event) override;
public slots:
    void handleWeatherData(const QVector<WeatherData> &weatherData);
};

#endif // TODAY_H
